<?php
namespace admin\models;

use common\models\Category;
use common\models\SearchInterface;
use common\models\SearchTrait;

class CategorySearch extends Category implements SearchInterface
{
    use SearchTrait;

    public function rules()
    {
        return [
            [['title'], 'trim'],
        ];
    }

    public function prepareQuery($query)
    {
        return $query->andFilterWhere(['title' => $this->title])
            ->orderBy('display_order desc');
    }
}
